Add a per-product documentation version selector#335
Open
miharp wants to merge 1 commit into
Open
Conversation
Render a version picker at the top of the sidebar, driven by _data/products.yml. For the current product it lists the versions (newest first), marks the one being viewed, and badges the version that `latest` aliases. Version links point at each version's root; switching is an infrequent, deliberate jump, and root links stay correct in the theme's persistent (Turbo-navigated) sidebar without per-page rewriting (keeping the reader on the same page across a switch is a possible later enhancement). - _includes/version-selector.html renders a block per qualifying product (2+ versions, not single_version) so the picker survives Turbo navigation between products. The wrapper is only emitted when at least one product qualifies, so nothing shows while every product still has a single version. - layout_end.html gains syncVersionPicker, which on each Turbo frame load shows the block matching the current collection and marks the active version (with a fallback to the `latest`-aliased version on /<product>/latest/ pages), mirroring the existing nav-group sync. - custom.css styles the picker to match the theme. Verified against a local two-version test bed (OpenVox 8.x + a 9.0.0-alpha1 9.x): correct active marking and latest badge on direct loads of 8.x, 9.x and the latest alias; correct group swap and active marking across Turbo navigation between products; OpenVox Containers (single_version) excluded; and no picker rendered while all products have one version. Part of OpenVoxProject#325. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
241eac9 to
3f378d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a per-product documentation version selector at the top of the sidebar, driven
by
_data/products.yml(introduced in #328).For the current product it lists the versions (newest first), marks the one being
viewed, and badges the version that
latestaliases — e.g.9.x·8.x (latest).Design notes
dropdown, which can't express per-product versions on a multi-product site, so
this is a custom picker reading
site.data.products.versions, so nothing shows on the site today (every product has one version) — it
appears automatically at the first cutover.
single_versionproducts (OpenVoxContainers) are always skipped.
/openvox/9.x/). The sidebar persists across Turbo navigation, so root links staycorrect without per-page rewriting. Keeping the reader on the same page across a
switch (path-preserving) would need per-navigation JS and is a possible follow-up.
syncVersionPicker(inlayout_end.html, alongside the existingnav-group sync) shows the current product's picker and marks the active version on
each
turbo:frame-load, with a fallback to thelatest-aliased version on/<product>/latest/pages.Validation
Verified against a local two-version test bed (OpenVox 8.x + a
9.0.0-alpha19.x),then torn down:
/8.x/,/9.x/, and the/latest/alias: correct active markingand latest badge.
the active version (browser-tested).
single_version) excluded.Part of #325.